package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TourismRestaurantMapper;
import com.ruoyi.system.domain.TourismRestaurant;
import com.ruoyi.system.service.ITourismRestaurantService;

import javax.annotation.Resource;

/**
 * 餐厅Service业务层处理
 *
 * @author gqd
 * @date 2020-12-25
 */
@Service
public class TourismRestaurantServiceImpl implements ITourismRestaurantService
{
    @Resource
    private TourismRestaurantMapper tourismRestaurantMapper;

    /**
     * 查询餐厅
     *
     * @param id 餐厅ID
     * @return 餐厅
     */
    @Override
    public TourismRestaurant selectTourismRestaurantById(Long id)
    {
        return tourismRestaurantMapper.selectTourismRestaurantById(id);
    }

    /**
     * 查询餐厅列表
     *
     * @param tourismRestaurant 餐厅
     * @return 餐厅
     */
    @Override
    public List<TourismRestaurant> selectTourismRestaurantList(TourismRestaurant tourismRestaurant)
    {
        return tourismRestaurantMapper.selectTourismRestaurantList(tourismRestaurant);
    }

    /**
     * 新增餐厅
     *
     * @param tourismRestaurant 餐厅
     * @return 结果
     */
    @Override
    public int insertTourismRestaurant(TourismRestaurant tourismRestaurant)
    {
        tourismRestaurant.setCreateTime(DateUtils.getNowDate());
        return tourismRestaurantMapper.insertTourismRestaurant(tourismRestaurant);
    }

    /**
     * 修改餐厅
     *
     * @param tourismRestaurant 餐厅
     * @return 结果
     */
    @Override
    public int updateTourismRestaurant(TourismRestaurant tourismRestaurant)
    {
        tourismRestaurant.setUpdateTime(DateUtils.getNowDate());
        return tourismRestaurantMapper.updateTourismRestaurant(tourismRestaurant);
    }

    /**
     * 批量删除餐厅
     *
     * @param ids 需要删除的餐厅ID
     * @return 结果
     */
    @Override
    public int deleteTourismRestaurantByIds(Long[] ids)
    {
        return tourismRestaurantMapper.deleteTourismRestaurantByIds(ids);
    }

    /**
     * 删除餐厅信息
     *
     * @param id 餐厅ID
     * @return 结果
     */
    @Override
    public int deleteTourismRestaurantById(Long id)
    {
        return tourismRestaurantMapper.deleteTourismRestaurantById(id);
    }
}
